package com.service.text;

import android.app.Activity;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.os.Bundle;
import android.os.IBinder;

public class MainActivity extends Activity{
Service appsService;
private ServiceConnection onService = new ServiceConnection(){
	public void onServiceConnected(ComponentName ServiceActivity, IBinder rawBinder){
		appsService = ((ServiceActivity.LocalBinder)rawBinder).getService();
	}

	public void onServiceDisconnected(ComponentName name) {
		appsService  = null;
		
	}
};
	public void onCreate(Bundle savedInstanceState){
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
		bindService( new Intent(this,ServiceActivity.class, onService, Context.BIND_AUTO_CREATE));
	}

}
